from rest_framework import serializers
from django.contrib.auth.models import Permission,ContentType

class PermissionSerialzier(serializers.ModelSerializer):
    """
        权限表序列化器
    """

    class Meta:
        # 指定生成序列化字段的模型类
        model = Permission
        # 指定字段
        fields = "__all__"


class ContentTypeSerialzier(serializers.ModelSerializer):
    """
           权限类型序列化器
       """
    name=serializers.CharField(read_only=True)
    class Meta:
        # 指定生成序列化字段的模型类
        model = ContentType
        # 指定字段
        fields = "__all__"


